home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / DELAY_OU.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  60 lines

  1. #define        CURSES_LIBRARY  1
  2. /*#define NEEDS_OS2       1*/
  3. #include <curses.h>
  4. #undef delay_output
  5.  
  6. #if defined(DOS) && defined(MSC)
  7. #include <time.h>
  8. #endif
  9.  
  10. #ifndef        NDEBUG
  11. char *rcsid_delay_ou = "$Header: c:/curses/portable/RCS/delay_ou.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
  12. #endif
  13.  
  14. #ifdef OS2
  15.        APIRET APIENTRY DosSleep(ULONG ulTime);
  16. #endif
  17.  
  18.  
  19. /*man-start*********************************************************************
  20.  
  21.   delay_output()       - cause short delay
  22.  
  23.   X/Open Description:
  24.        Insert ms millisecond pause in output.  On some systems, this
  25.        has no effect.
  26.  
  27.   PDCurses Description:
  28.        This routine relies on the compiler's delay() routine and
  29.        provides this x millisecond granularity to the application.
  30.  
  31.   X/Open Return Value:
  32.        The delay_output() function returns OK on success and ERR on error.
  33.  
  34.   PDCurses Errors:
  35.        If this function is a nop, then an ERR is returned.
  36.  
  37.   Portability:
  38.        PDCurses        int delay_output( int ms );
  39.        X/Open Dec '88  int delay_output( int ms );
  40.        BSD Curses      
  41.        SYS V Curses    
  42.  
  43. **man-end**********************************************************************/
  44.  
  45. int    delay_output( int ms )
  46. {
  47. #if defined(TC) && defined(DOS)
  48.        delay( ms );
  49.        return( OK );
  50. #endif
  51. #if    defined(OS2)
  52.        DosSleep(ms);
  53.        return( OK );
  54. #endif
  55. #if    defined(DOS) && defined(MSC)
  56.        PDC_usleep((clock_t)ms);
  57.        return( OK );
  58. #endif
  59. }
  60.